package uk.co.q3c.deplan.client.service.callback;

import java.util.List;

import uk.co.q3c.deplan.client.domain.DomainObject;

import com.google.gwt.user.client.rpc.AsyncCallback;

/**
 * Convenience base class for any call backs which are required to update the cache on a successful return
 * 
 * @author David Sowerby 15 Aug 2010
 * 
 */
public class CacheCallback implements AsyncCallback<List<? extends DomainObject>> {

	@Override
	public void onFailure(Throwable caught) {
		throw new RuntimeException("Callback failed, caused by: ", caught);

	}

	@Override
	public void onSuccess(List<? extends DomainObject> result) {
		updateCache(result);

	}

	protected void updateCache(List<? extends DomainObject> result) {
		throw new RuntimeException("Not yet implemented");
	}

}
